package com.bw.controller;

import com.bw.bean.Movie;
import com.bw.service.MovieService;
import com.sugar.SugarUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
public class MovieController {
    @Autowired
    MovieService movieService;

    @RequestMapping("/list1")
    public Map getList1(){
        List<Movie> list1 =movieService.getList1();
        return SugarUtil.getMapData(list1);
    }
    @RequestMapping("/list2")
    public Map getList2(){
        String s="西";
        List<Movie> list2 = movieService.getList2(s);
        return SugarUtil.getMapData(list2);
    }
    @RequestMapping("/list3")
    public Map getList3(){
        List<Movie> list3 = movieService.getList3();
        return SugarUtil.getMapData(list3);
    }

    @RequestMapping("/list4")
    public Map getList4(){
        List<Movie> list4 = movieService.getList4("张艺谋");
        return SugarUtil.getMapData(list4);
    }
}
